package com.focusai.efairy.ui.adapter.project;

import android.content.Context;

import com.focusai.efairy.R;
import com.focusai.efairy.model.project.DevIccIdItem;
import com.focusai.efairy.ui.adapter.base.BaseRecyclerAdapter;
import com.focusai.efairy.ui.adapter.base.BaseRecyclerViewHolder;

/**
 * Created by luo_guangwen on 2017/9/8.
 */

public class ProjectSelectDevIccIdAdapter extends BaseRecyclerAdapter<DevIccIdItem> {

    public ProjectSelectDevIccIdAdapter(Context mContext) {
        super(mContext);
    }

    @Override
    protected int getItemLayoutId() {
        return R.layout.item_left_text;
    }

    @Override
    protected void onBindBaseRecyclerViewHolder(BaseRecyclerViewHolder holder, int position) {
        DevIccIdItem devIccIdItem = mList.get(position);
        holder.setText(R.id.text_left, devIccIdItem.efairyiotcard_number);
        if(devIccIdItem.efairyiotcard_is_used == 1){
            holder.setText(R.id.text_left1,"[已使用]");
            holder.getTextView(R.id.text_left1).setTextColor(mContext.getResources().getColor(R.color.font_dev_has_used));
        }else {
            holder.setText(R.id.text_left1,"");
            holder.getTextView(R.id.text_left1).setTextColor(mContext.getResources().getColor(R.color.font_dev_no_used));
        }
    }

}